package com.example.departmentService.service.impl;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.departmentService.entity.ResumeBlock;
import com.example.departmentService.entity.TalentPool;
import com.example.departmentService.entity.dto.ResumeConditons;
import com.example.departmentService.mapper.TalentPoolMapper;
import com.example.departmentService.service.ITalentPoolService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class TalentPoolServiceImpl extends ServiceImpl<TalentPoolMapper, TalentPool> implements ITalentPoolService {
    @Resource
    private TalentPoolMapper talentPoolMapper;

    @Override
    public List<TalentPool> findAll() {
        List<TalentPool> talentPools = talentPoolMapper.selectList(null);
        return talentPools;
    }

    @Override
    public Integer insert(TalentPool talentPool) {
        TalentPool talentPool1 = new TalentPool();
        talentPool1.setName(talentPool.getName());
        talentPool1.setCompany(talentPool.getCompany());
        talentPool1.setPost(talentPool.getPost());
        talentPool1.setAchievement(talentPool.getAchievement());
        int item = talentPoolMapper.insert(talentPool1);
        return item;
    }
    @Override
    public List<TalentPool> selectList(TalentPool talentPool) {
        QueryWrapper<TalentPool> wrapper = new QueryWrapper<>();
        wrapper.eq(talentPool.getName()!=null,"NAME", talentPool.getName());
        List<TalentPool> talentPools = talentPoolMapper.selectList(wrapper);
        return talentPools;
    }
}
